﻿using System;
using System.Collections.Generic;
using System.Text;
using Quartz;
using Quartz.Impl;

namespace QuartzStudyConsole
{
    class Program
    {
        static void Main(string[] args)
        {
            ISchedulerFactory factory = new StdSchedulerFactory();
            IScheduler scheduler= factory.GetScheduler();
            

            // construct job info
            JobDetail jobDetail = new JobDetail("SimplyJob",
                                              null,
                                              typeof(SimplyJob));
            // fire every hour
            Trigger trigger = TriggerUtils.MakeMinutelyTrigger();
            //trigger = TriggerUtils.MakeDailyTrigger("daily",0,1);
            // start on the next even hour
            //trigger.StartTimeUtc = TriggerUtils.GetEvenMinuteDate(DateTime.Now);
            trigger.Name = "myTrigger";
            scheduler.ScheduleJob(jobDetail, trigger);

            scheduler.Start();
        }
    }
}